<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="./style.css">
    <style>
        ul,li { list-style: none; padding: 0; margin: 0;}
        ul {font-size: 14px;color: #fff;padding: 10px;}
        li {margin-bottom: 10px;}
        li:hover {background-color: #5aa9ff;cursor: pointer;}
    </style>
</head>
<body>
    <div class="rectangle-box">
        <div class="center" style="position: relative;">
            <div style="position:absolute;width: 5px;height: 30px;background:#fff;top: 15px;left: 27px;"></div>
            <div style="position:absolute;width: 30px;height: 5px;background:#fff;top: 27px;left: 15px;"></div>
        </div>
        <div class="options" style="position:absolute;left: 0;top: 0;">
            <ul>
                <li>记账</li>
                <li>查看记账明细</li>
                <li>记账</li>
            </ul>
        </div>
    </div>
    <script>
        document.addEventListener("DOMContentLoaded", function() {
            var rectangleBox = document.querySelector('.rectangle-box');
            var centerBox = document.querySelector('.center')
            var optionBox = document.querySelector('.options')
            var isCircle = false;

            rectangleBox.addEventListener('click', function(e) {
                console.log(e)
                if (!isCircle) {
                    this.style.animation = 'circleAnimation 0.3s forwards';
                    centerBox.style.animation = 'centerAnimationIn 0.2s forwards';
                    optionBox.style.animation = 'centerAnimationOut 0.2s forwards 0.2s';
                    isCircle = true;
                } else {
                    this.style.animation = 'rectangleAnimation 0.3s forwards';
                    centerBox.style.animation = 'centerAnimationOut 0.2s forwards';
                    optionBox.style.animation = 'centerAnimationIn 0.1s forwards';
                    isCircle = false;
                }
            });
        });

    </script>
</body>
</html>